home *** CD-ROM | disk | FTP | other *** search
/ Deutsche Edition 1 / Deutsche Edition 1.iso / amok / amok_lha / amok15.lha / Seafarers_Manual / Source / C2P5.mod < prev    next >
Text File  |  1993-08-15  |  855b  |  34 lines

  1. MODULE C2P5;   (* Chapter 2  Problem 5 *)
  2.            (* Real Calculations *)
  3.  
  4.    (* From the book "Modula-2  A Seafarer's Manual and Shipyard Guide" *)
  5.    (* Page 41   adapted "M2Amiga Modula-2"   26 Feb 1988 *)
  6.  
  7. FROM InOut IMPORT WriteLn,
  8.           WriteString;
  9. FROM RealInOut IMPORT WriteReal;
  10.                   
  11. VAR
  12.   Result : REAL;
  13.   
  14. BEGIN
  15.   WriteString ("Real Calculations: ");
  16.   WriteLn; WriteLn; WriteLn;
  17.   WriteString ("79413 inches are ");
  18.   Result := 79413.0 / (6.0 * 12.0);
  19.   WriteReal (Result,11,6);
  20.   WriteString (" fathoms");
  21.   WriteLn; WriteLn;
  22.   WriteString ("One mile has ");
  23.   Result := (5280.0 * 12.0) / 39.37;
  24.   WriteReal (Result,11,6);
  25.   WriteString (" meters");
  26.   WriteLn; WriteLn;
  27.   WriteString ("The speed of sound is ");
  28.   Result := 1088.0 / 5280.0;
  29.   WriteReal (Result,11,6);
  30.   WriteString (" miles per second");
  31.   WriteLn;
  32.   
  33. END C2P5.
  34.